<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<html>
<head>
<title></title>
<%@include file="/common/meta.jsp"%>
<%@include file="/common/ec.jsp"%>
</head>
<body>
<div class="x-panel-header">
	&nbsp;项目预算管理&nbsp;&nbsp;&nbsp;&nbsp;
</div>
<div class="x-toolbar" align="right" style="padding:5px;">
  <a href="editNew.do"><img src="${ctx}/images/icons/add.gif">添加项目预算</a>
  &nbsp;&nbsp;
</div>
<div style="margin-left:-2px;">
<ec:table items="items" var="item" retrieveRowsCallback="process" sortRowsCallback="process" 
	action="index.do" 
	useAjax="false"
	doPreload="false" 
	pageSizeList="20,50" 
	editable="false"
	sortable="false" 
	rowsDisplayed="20" 
	generateScript="true"
	resizeColWidth="false" 
	classic="false" 
	width="100%" 
	height="320px"
	minHeight="320"
	showHeader="true"
	toolbarContent="navigation|pagejump|pagesize|refresh|extend|status">
	<ec:row>
		<ec:column width="35" property="_no." title="No." value="${GLOBALROWCOUNT}" style="text-align:center;" />
		<ec:column width="250" property="project.name" title="项目名称"/>
		<ec:column width="150" property="project.managerNames" title="项目负责人" ellipsis="true"/>
		<ec:column width="100" property="creater.name" title="预算制定人"/>
		<ec:column width="100" property="_amount" title="预算额" style="text-align:right;  font-family: sans-serif;">
		  <span style="color: green">${item.amount}&yen;&nbsp;</span>
		</ec:column>
		<ec:column width="100" property="_isv" title="审核状态" style="text-align:center">
		  <s:if test='#attr.item.audStatus == "pending"'>
			<span style="color: blue;">待审核</span>
		  </s:if>
		  <s:elseif test='#attr.item.audStatus == "pass"'>
			<span style="color: green;">已通过</span>
		  </s:elseif>
		  <s:elseif test='#attr.item.audStatus == "nopass"'>
			<span style="color: red;">未通过</span>
		  </s:elseif>
		  <s:else>
			<span style="color:olive;">未发送申请</span>&nbsp;
			<span><a href="#" title="发送预算审核申请" onclick="sendAudit('${item.id}')">申请</a></span>
		  </s:else>
		</ec:column>
		<ec:column width="100" property="_opt" title="操作" style="text-align:center;">
		  <a href="view.do?model.id=${item.id}" target="_blank">查看</a>
		  <s:if test='#attr.item.audStatus == "unsend"'>
		    <a href="edit.do?model.id=${item.id}">编辑</a>
		  </s:if>
		</ec:column>
	</ec:row>
</ec:table>
</div>
<script type="text/javascript">
	function remove(id) {
		if (confirm("确实要删除本项目吗?")) {
			window.location.href = "remove.do?model.id=" + id;
		}
	}
	
	//更新状态
	function updateState(msg, id){
		if (confirm(msg)){
			window.location.href = "updateState.do?model.id=" + id;
		}
	}
	
	function sendAudit(id){
		if (confirm("确认要发生审核申请吗?")){
			window.location.href = "createAudFlow.do?model.id=" + id;
		}
	}
		
</script>
</body>
</html>